describe('Rule manage', () => {

    it('测试getDirectNum函数，应符合期望值', () => {
        expect(dataHelper.getDirectNum(docData)).toEqual(3)
        expect(dataHelper.getDirectNum(docData.directories[1])).toEqual(1)
        expect(dataHelper.getDirectNum(docData.directories[0])).toEqual(0)
    })

    it('测试getFileNum函数，应符合期望值', () => {
        expect(dataHelper.getFileNum(docData)).toEqual(0)
        expect(dataHelper.getFileNum(docData.directories[1])).toEqual(3)
        expect(dataHelper.getFileNum(docData.directories[0])).toEqual(3)
    })

    it('测试getTotalSize函数，应符合期望值', () => {
        expect(dataHelper.getTotalSize(docData)).toEqual(14)
    })

    describe('转换后的数据', () => {
        let converted
        beforeEach(() => {
            converted = dataHelper.convert2JstreeData(docData.directories)
            window.convertedData = converted
        })

        it('转换后符合预期长度', () => {
            expect(converted.length).toEqual(3)
        })
    })
})